#!/bin/sh
. /etc/nap.conf
name=`napconfig name | urlencode.tcl`
host=`hostname | urlencode.tcl`
ip=`extractip "$1"`

if [ ! -f "$napdata/memos/$2" ]
then
	echo ERROR no memo $2 found
	return
fi
if [ ! -e "$napshared/memos/$2" ] 
then
	ln -s "$napdata/memos/$2" "$napshared/memos/$2" || echo ERROR ln && return
fi
wget -q -O - "http://$ip/memo.cgi?name=$name&host=$host&memo=$2"

# clean up after ourselves
rm "$napshared/memos/$2" 2>/dev/null


